package org.hfy.calc;

import org.hfy.collections.helper.Symbol;

import java.util.Map;

/**
 * @Description:
 * @Author: Takagi
 * @date: 2023/5/28
 */
public class AnalysisElement {
    public AnalysisElement() {
        elementType = symbolElement;
    }
    public AnalysisElement(int type) {
        elementType = type;
    }

    // 符号
    public static int symbolElement = 1;
    public static int actionElement = 2;
    public int elementType;
    public Symbol name;
    public Map<String, Integer> attribute;

    public void setName(Symbol name) {
        this.name = name;
    }

    public void setActionType(int actionType) {
        this.actionType = actionType;
    }

    public void setElementType(int elementType) {
        this.elementType = elementType;
    }

    public Integer getAttr(String key) {
        return attribute.get(key);
    }

    public void setAttr(String key, Integer val) {
        attribute.put(key, val);
    }

    // 动作
    public static int calculationAction = 1;
    public static int helpAction = 2;
    public int actionType;
    public SemanticAction action;

}
